

/**
 * int		Standing
 * int 		Weight
 * string	cat  T恤，正装衬衫，休闲衬衫
 */
function check_size(standing, weight, cat){
    if (standing >= 163 && standing <= 166) {
        if (weight >= 40 && weight <= 65) {
            if (cat == '正装') {
                return 38;
            }
            else {
                return 'S';
            }
        }
        else 
            if (weight >= 66 && weight <= 75) {
                if (cat == '正装') {
                    return 39;
                }
                else {
                    return 'M';
                }
            }
            else 
                if (weight >= 76 && weight <= 80) {
                    if (cat == '正装') {
                        return 40;
                    }
                    else {
                        return 'L';
                    }
                }
                else 
                    if (weight >= 81 && weight <= 85) {
                        if (cat == '正装') {
                            return 41;
                        }
                        else {
                            return 'L';
                        }
                    }
                    else 
                        if (weight >= 86 && weight <= 88) {
                            if (cat == '正装') {
                                return 42;
                            }
                            else {
                                return 'XL';
                            }
                        }
                        else 
                            if (weight >= 89 && weight <= 95) {
                                if (cat == '正装') {
                                    return 43
                                }
                                else {
                                    return 'XXL';
                                }
                            }
    }
    //167 -----  169
    else 
        if (standing >= 167 && standing <= 169) {
            if (weight >= 40 && weight <= 65) {
                if (cat == '正装') {
                    return 38
                }
                else {
                    return 'S';
                }
            }
            else 
                if (weight >= 66 && weight <= 70) {
                    if (cat == '正装') {
                        return 39
                    }
                    else {
                        return 'M';
                    }
                }
                else 
                    if (weight >= 71 && weight <= 75) {
                        if (cat == '正装') {
                            return 40
                        }
                        else {
                            return 'L';
                        }
                    }
                    else 
                        if (weight >= 76 && weight <= 80) {
                            if (cat == '正装') {
                                return 41
                            }
                            else {
                                return 'L';
                            }
                        }
                        else 
                            if (weight >= 81 && weight <= 85) {
                                if (cat == '正装') {
                                    return 42
                                }
                                else {
                                    return 'XL';
                                }
                            }
                            else 
                                if (weight >= 86 && weight <= 95) {
                                    if (cat == '正装') {
                                        return 43
                                    }
                                    else {
                                        return 'XXL';
                                    }
                                }
        }
        else 
            if (standing >= 170 && standing <= 172) {
                if (weight >= 40 && weight <= 70) {
                    if (cat == '正装') {
                        return 39
                    }
                    else {
                        return 'M';
                    }
                }
                else 
                    if (weight >= 71 && weight <= 75) {
                        if (cat == '正装') {
                            return 40
                        }
                        else {
                            return 'L';
                        }
                    }
                    else 
                        if (weight >= 76 && weight <= 80) {
                            if (cat == '正装') {
                                return 41
                            }
                            else {
                                return 'L';
                            }
                        }
                        else 
                            if (weight >= 81 && weight <= 85) {
                                if (cat == '正装') {
                                    return 42
                                }
                                else {
                                    return 'XL';
                                }
                            }
                            else 
                                if (weight >= 86 && weight <= 95) {
                                    if (cat == '正装') {
                                        return 43
                                    }
                                    else {
                                        return 'XXL';
                                    }
                                }
            }
            else 
                if (standing >= 173 && standing <= 175) {
                    if (weight >= 40 && weight <= 75) {
                        if (cat == '正装') {
                            return 40
                        }
                        else {
                            return 'L';
                        }
                    }
                    else 
                        if (weight >= 76 && weight <= 80) {
                            if (cat == '正装') {
                                return 41
                            }
                            else {
                                return 'L';
                            }
                        }
                        else 
                            if (weight >= 81 && weight <= 90) {
                                if (cat == '正装') {
                                    return 42
                                }
                                else {
                                    return 'XL';
                                }
                            }
                            else 
                                if (weight >= 91 && weight <= 95) {
                                    if (cat == '正装') {
                                        return 43
                                    }
                                    else {
                                        return 'XXL';
                                    }
                                }
                }
                else 
                    if (standing >= 176 && standing <= 178) {
                        if (weight >= 40 && weight <= 75) {
                            if (cat == '正装') {
                                return 41
                            }
                            else {
                                return 'L';
                            }
                        }
                        else 
                            if (weight >= 76 && weight <= 90) {
                                if (cat == '正装') {
                                    return 42
                                }
                                else {
                                    return 'XL';
                                }
                            }
                            else 
                                if (weight >= 91 && weight <= 95) {
                                    if (cat == '正装') {
                                        return 43
                                    }
                                    else {
                                        return 'XXL';
                                    }
                                }
                    }
                    else 
                        if (standing >= 179 && standing <= 182) {
                            if (weight >= 40 && weight <= 65) {
                                if (cat == '正装') {
                                    return 41
                                }
                                else {
                                    return 'L';
                                }
                            }
                            else 
                                if (weight >= 66 && weight <= 80) {
                                    if (cat == '正装') {
                                        return 42
                                    }
                                    else {
                                        return 'XL';
                                    }
                                }
                                else 
                                    if (weight >= 81 && weight <= 95) {
                                        if (cat == '正装') {
                                            return 43
                                        }
                                        else {
                                            return 'XXL';
                                        }
                                    }
                        }
                        else 
                            if (standing >= 183 && standing <= 188) {
                                if (weight >= 40 && weight <= 95) {
                                    if (cat == '正装') {
                                        return 43
                                    }
                                    else {
                                        return 'XXL';
                                    }
                                }
                                else {
                                    return false;
                                }
                            }
}

function compute(cat){
    var standing = document.getElementById('standing').value;
    if (standing == '') 
        standing = document.getElementById('standing1').value;
    var weight = document.getElementById('weight').value;
    if (weight == '') 
        weight = document.getElementById('weight1').value;
    if (standing == '') {
        document.getElementById('result').innerHTML = '请填写身高！';
        document.getElementById('result1').innerHTML = '请填写身高！';
        return false;
    }
    if (weight == '') {
        document.getElementById('result').innerHTML = '请填写体重！';
        document.getElementById('result1').innerHTML = '请填写体重！';
        return false;
    }
    //验证输入的身高和体重是否有效
    if (check_size(standing, weight, cat)) {
        document.getElementById('result').innerHTML = "我们建议您选择" + check_size(standing, weight, cat) + "尺码";
        document.getElementById('result1').innerHTML = "我们建议您选择" + check_size(standing, weight, cat) + "尺码";
    }
    else {
        document.getElementById('result').innerHTML = '请按要求范围填写！';
        document.getElementById('result1').innerHTML = '请按要求范围填写！';
    }
}

/**
 * 裤子的腰围，厘米，市尺，英寸
 * 返回尺码
 */
function trousers_size(goods_id){

    var cm = document.getElementById('cm').value;
    if (cm == '') 
        var cm = document.getElementById('cm_1').value;
    
    var ruler = document.getElementById('ruler').value;
    if (ruler == '') 
        var ruler = document.getElementById('ruler_1').value;
    
    var inch = document.getElementById('inch').value;
    if (inch == '') 
        var inch = document.getElementById('inch_1').value;
    if (cm != '') {
        //特殊商品计算公式不同
        if (goods_id == 2118 || goods_id == 2157) {
            if (cm >= 72 && cm <= 75) {
                return 29;
            }
            else 
                if (cm >= 76 && cm <= 77) {
                    return 30;
                }
                else 
                    if (cm >= 78 && cm <= 81) {
                        return 31;
                    }
                    else 
                        if (cm >= 82 && cm <= 83) {
                            return 32;
                        }
                        else 
                            if (cm >= 84 && cm <= 85) {
                                return 33;
                            }
                            else 
                                if (cm >= 86 && cm <= 87) {
                                    return 34;
                                }
                                else 
                                    if (cm >= 88 && cm <= 91) {
                                        return 35;
                                    }
                                    else 
                                        if (cm >= 92 && cm <= 93) {
                                            return 36;
                                        }
                                        else 
                                            if (cm >= 94 && cm <= 99) {
                                                return 37;
                                            }
                                            else 
                                                if (cm >= 100 && cm <= 101) {
                                                    return 39;
                                                }
                                                else 
                                                    if (cm >= 102 && cm <= 103) {
                                                        return 40;
                                                    }
                                                    else 
                                                        if (cm >= 104) {
                                                            return 41;
                                                        }
        }
        else {
            if (cm >= 72 && cm <= 75) {
                return 29;
            }
            else 
                if (cm >= 76 && cm <= 77) {
                    return 30;
                }
                else 
                    if (cm >= 78 && cm <= 81) {
                        return 31;
                    }
                    else 
                        if (cm >= 82 && cm <= 83) {
                            return 32;
                        }
                        else 
                            if (cm >= 84 && cm <= 85) {
                                return 33;
                            }
                            else 
                                if (cm >= 86 && cm <= 87) {
                                    return 34;
                                }
                                else 
                                    if (cm >= 88 && cm <= 91) {
                                        return 35;
                                    }
                                    else 
                                        if (cm >= 92 && cm <= 93) {
                                            return 36;
                                        }
                                        else 
                                            if (cm >= 94 && cm <= 99) {
                                                return 37;
                                            }
                                            else 
                                                if (cm >= 100 && cm <= 101) {
                                                    return 39;
                                                }
                                                else 
                                                    if (cm >= 102 && cm <= 103) {
                                                        return 40;
                                                    }
                                                    else 
                                                        if (cm >= 104) {
                                                            return 41;
                                                        }
        }
    }
    if (ruler != '') {
        //特殊商品计算公式不同
        if (goods_id == 2118 || goods_id == 2157) {
            if (ruler >= 2.10 && ruler <= 2.25) {
                return 29;
            }
            else 
                if (ruler >= 2.26 && ruler <= 2.30) {
                    return 30;
                }
                else 
                    if (ruler >= 2.31 && ruler <= 2.35) {
                        return 31;
                    }
                    else 
                        if (ruler >= 2.36 && ruler <= 2.45) {
                            return 32;
                        }
                        else 
                            if (ruler >= 2.46 && ruler <= 2.50) {
                                return 33;
                            }
                            else 
                                if (ruler >= 2.51 && ruler <= 2.6) {
                                    return 34;
                                }
                                else 
                                    if (ruler >= 2.61 && ruler <= 2.65) {
                                        return 35;
                                    }
                                    else 
                                        if (ruler >= 2.66 && ruler <= 2.75) {
                                            return 36;
                                        }
                                        else 
                                            if (ruler >= 2.76 && ruler <= 2.8) {
                                                return 37;
                                            }
                                            else 
                                                if (ruler >= 2.81 && ruler <= 2.95) {
                                                    return 39;
                                                }
                                                else 
                                                    if (ruler >= 2.96 && ruler <= 3.05) {
                                                        return 40;
                                                    }
                                                    else 
                                                        if (ruler >= 3.06 && ruler <= 3.10) {
                                                            return 41;
                                                        }
        }
        else {
            if (ruler >= 2.10 && ruler <= 2.25) {
                return 29;
            }
            else 
                if (ruler >= 2.26 && ruler <= 2.30) {
                    return 30;
                }
                else 
                    if (ruler >= 2.31 && ruler <= 2.35) {
                        return 31;
                    }
                    else 
                        if (ruler >= 2.36 && ruler <= 2.45) {
                            return 32;
                        }
                        else 
                            if (ruler >= 2.46 && ruler <= 2.50) {
                                return 33;
                            }
                            else 
                                if (ruler >= 2.51 && ruler <= 2.6) {
                                    return 34;
                                }
                                else 
                                    if (ruler >= 2.61 && ruler <= 2.65) {
                                        return 35;
                                    }
                                    else 
                                        if (ruler >= 2.66 && ruler <= 2.75) {
                                            return 36;
                                        }
                                        else 
                                            if (ruler >= 2.76 && ruler <= 2.8) {
                                                return 37;
                                            }
                                            else 
                                                if (ruler >= 2.81 && ruler <= 2.95) {
                                                    return 39;
                                                }
                                                else 
                                                    if (ruler >= 2.96 && ruler <= 3.05) {
                                                        return 40;
                                                    }
                                                    else 
                                                        if (ruler >= 3.06 && ruler <= 3.10) {
                                                            return 41;
                                                        }
        }
    }
    if (inch != '') {
        //特殊商品计算公式不同
        if (goods_id == 2118 || goods_id == 2157) {
            if (inch >= 28.0 && inch <= 29.9) {
                return 29;
            }
            else 
                if (inch >= 30.0 && inch <= 30.9) {
                    return 30;
                }
                else 
                    if (inch >= 31.0 && inch <= 31.9) {
                        return 31;
                    }
                    else 
                        if (inch >= 32.0 && inch <= 32.9) {
                            return 32;
                        }
                        else 
                            if (inch >= 33.0 && inch <= 33.9) {
                                return 33;
                            }
                            else 
                                if (inch >= 34.0 && inch <= 34.9) {
                                    return 34;
                                }
                                else 
                                    if (inch >= 35.0 && inch <= 35.9) {
                                        return 35;
                                    }
                                    else 
                                        if (inch >= 36.0 && inch <= 36.9) {
                                            return 36;
                                        }
                                        else 
                                            if (inch >= 37.0 && inch <= 38.9) {
                                                return 37;
                                            }
                                            else 
                                                if (inch >= 39.0 && inch <= 39.9) {
                                                    return 39;
                                                }
                                                else 
                                                    if (inch >= 39.0 && inch <= 40.9) {
                                                        return 40;
                                                    }
                                                    else 
                                                        if (inch >= 41.0) {
                                                            return 41;
                                                        }
        }
        else {
            if (inch >= 28.0 && inch <= 29.9) {
                return 29;
            }
            else 
                if (inch >= 30.0 && inch <= 30.9) {
                    return 30;
                }
                else 
                    if (inch >= 31.0 && inch <= 31.9) {
                        return 31;
                    }
                    else 
                        if (inch >= 32.0 && inch <= 32.9) {
                            return 32;
                        }
                        else 
                            if (inch >= 33.0 && inch <= 33.9) {
                                return 33;
                            }
                            else 
                                if (inch >= 34.0 && inch <= 34.9) {
                                    return 34;
                                }
                                else 
                                    if (inch >= 35.0 && inch <= 35.9) {
                                        return 35;
                                    }
                                    else 
                                        if (inch >= 36.0 && inch <= 36.9) {
                                            return 36;
                                        }
                                        else 
                                            if (inch >= 37.0 && inch <= 38.9) {
                                                return 37;
                                            }
                                            else 
                                                if (inch >= 38.0 && inch <= 39.9) {
                                                    return 39;
                                                }
                                                else 
                                                    if (inch >= 39.0 && inch <= 40.9) {
                                                        return 40;
                                                    }
                                                    else 
                                                        if (inch >= 41.0) {
                                                            return 41;
                                                        }
        }
    }
}

//裤子的尺码计算
function trousers_compute(goods_id){
    //验证输入的身高和体重是否有效
    if (trousers_size(goods_id)) {
        document.getElementById('result').innerHTML = "我们建议您选择" + trousers_size(goods_id) + "尺码";
        document.getElementById('result1').innerHTML = "我们建议您选择" + trousers_size(goods_id) + "尺码";
    }
    else {
        document.getElementById('result').innerHTML = '请按要求范围填写您的腰围！';
        document.getElementById('result1').innerHTML = '请按要求范围填写您的腰围！';
    }
}

function clear_input(id_1, id_2, id_3){
    document.getElementById(id_1 + '_size').checked = true;
    document.getElementById(id_2).value = '';
    document.getElementById(id_3).value = '';
    document.getElementById('result').innerHTML = '';
    document.getElementById('result1').innerHTML = '';
}

function radio_checked(id){
    document.getElementById(id).focus();
}

function del(id){
    if (id == 'ruler') {
        document.getElementById('cm_1').value = "";
    }
    else 
        if (id == 'inch') {
            document.getElementById('ruler_1').value = "";
            document.getElementById('cm_1').value = "";
        }
}

function hidden_option(){
    document.getElementById('goods_number').sytle.display = 'none';
}

function dis_option(){
    document.getElementById('goods_number').sytle.display = 'block';
}


//增加计算内衣和外套的尺码2008-11-5 14:45:57
function chima_compute(cat)//1 内衣   2   外套
{
    var standing = document.getElementById('standing').value;
    if (standing == '') 
        standing = document.getElementById('standing1').value;
    var weight = document.getElementById('weight').value;
    if (weight == '') 
        weight = document.getElementById('weight1').value;
    //验证输入的身高和体重是否有效
    
    if (standing == '') {
        document.getElementById('result').innerHTML = '请填写身高！';
        document.getElementById('result1').innerHTML = '请填写身高！';
        return false;
    }
    if (weight == '') {
        document.getElementById('result').innerHTML = '请填写体重！';
        document.getElementById('result1').innerHTML = '请填写体重！';
        return false;
    }
    //var x;
    //var   neiku_table   =   new   Array({{12,13,14},{112,114,115}});
    if (cat == 1) {
        var mydata = [[163, 166, 40, 65, 'M'], [163, 166, 66, 75, 'M'], [163, 166, 76, 80, 'L'], [163, 166, 81, 85, 'L'], [163, 166, 86, 88, 'XL'], [163, 166, 89, 95, 'XL'], [167, 169, 40, 65, 'M'], [167, 169, 66, 70, 'M'], [167, 169, 71, 75, 'L'], [167, 169, 76, 80, 'L'], [167, 169, 81, 85, 'XL'], [167, 169, 86, 95, 'XL'], [170, 172, 40, 70, 'M'], [170, 172, 71, 75, 'L'], [170, 172, 76, 80, 'L'], [170, 172, 81, 85, 'XL'], [170, 172, 86, 95, 'XL'], [173, 175, 40, 75, 'L'], [173, 175, 76, 80, 'L'], [173, 175, 81, 90, 'XL'], [173, 175, 91, 95, 'XL'], [176, 178, 40, 75, 'L'], [176, 178, 76, 90, 'XL'], [176, 178, 91, 95, 'XL'], [179, 182, 40, 65, 'L'], [179, 182, 66, 80, 'XL'], [179, 182, 81, 95, 'XL'], [183, 188, 40, 95, 'XL']];
    }
    //9001外其他外套
    if (cat == 2) {
        //var mydata = [[163,166,40,65,'S'],[163,166,66,75,'M'],[163,166,76,80,'L'],[163,166,81,85,'L'],[163,166,86,88,'XL'],[167,169,40,65,'S'],[167,169,66,70,'M'],[167,169,71,75,'L'],[167,169,76,80,'L'],[167,169,81,85,'XL'],[170,172,40,70,'M'],[170,172,71,75,'L'],[170,172,76,80,'L'],[170,172,81,85,'XL'],[173,175,40,75,'L'],[173,175,76,80,'L'],[173,175,81,90,'XL'],[176,178,40,75,'L'],[176,178,76,90,'XL'],[179,182,40,65,'L'],[179,182,66,90,'XL']];
        var mydata = [[163, 166, 40, 65, 'S'], [163, 166, 66, 75, 'M'], [163, 166, 76, 80, 'L'], [163, 166, 81, 85, 'L'], [163, 166, 86, 88, 'XL'], [163, 166, 89, 95, 'XXL'], [167, 169, 40, 65, 'S'], [167, 169, 66, 70, 'M'], [167, 169, 71, 75, 'L'], [167, 169, 76, 80, 'L'], [167, 169, 81, 85, 'XL'], [167, 169, 86, 95, 'XXL'], [170, 172, 40, 70, 'M'], [170, 172, 71, 75, 'L'], [170, 172, 76, 80, 'L'], [170, 172, 81, 85, 'XL'], [170, 172, 86, 95, 'XXL'], [173, 175, 40, 75, 'L'], [173, 175, 76, 80, 'L'], [173, 175, 81, 90, 'XL'], [173, 175, 91, 95, 'XXL'], [176, 178, 40, 75, 'L'], [176, 178, 76, 90, 'XL'], [176, 178, 91, 95, 'XXL'], [179, 182, 40, 65, 'L'], [179, 182, 66, 80, 'XL'], [179, 182, 81, 95, 'XXL'], [183, 188, 40, 95, 'XXL']];
    }
    //毛衫
    if (cat == 3) {
        var mydata = [[163, 166, 40, 60, 'S'], [163, 166, 61, 75, 'M'], [163, 166, 76, 80, 'L'], [163, 166, 81, 85, 'L'], [163, 166, 86, 88, 'XL'], [163, 166, 89, 95, 'XXL'], [167, 169, 40, 60, 'S'], [167, 169, 61, 70, 'M'], [167, 169, 71, 75, 'L'], [167, 169, 76, 80, 'L'], [167, 169, 81, 85, 'XL'], [167, 169, 86, 95, 'XXL'], [170, 172, 40, 70, 'M'], [170, 172, 71, 75, 'L'], [170, 172, 76, 80, 'L'], [170, 172, 81, 85, 'XL'], [170, 172, 86, 95, 'XXL'], [173, 175, 40, 75, 'L'], [173, 175, 76, 80, 'L'], [173, 175, 81, 90, 'XL'], [173, 175, 91, 95, 'XXL'], [176, 178, 40, 75, 'L'], [176, 178, 76, 90, 'XL'], [176, 178, 91, 95, 'XXL'], [179, 182, 40, 65, 'L'], [179, 182, 66, 80, 'XL'], [179, 182, 81, 95, 'XXL'], [183, 188, 40, 95, 'XXL']];
    }
    //9001
    if (cat == 4) {
        var mydata = [[163, 166, 40, 65, 'S'], [163, 166, 66, 75, 'M'], [163, 166, 76, 80, 'L'], [163, 166, 81, 85, 'L'], [163, 166, 86, 88, 'XL'], [167, 169, 40, 65, 'S'], [167, 169, 66, 70, 'M'], [167, 169, 71, 75, 'L'], [167, 169, 76, 80, 'L'], [167, 169, 81, 85, 'XL'], [170, 172, 40, 70, 'M'], [170, 172, 71, 75, 'L'], [170, 172, 76, 80, 'L'], [170, 172, 81, 85, 'XL'], [173, 175, 40, 75, 'L'], [173, 175, 76, 80, 'L'], [173, 175, 81, 90, 'XL'], [176, 178, 40, 75, 'L'], [176, 178, 76, 90, 'XL'], [179, 182, 40, 65, 'L'], [179, 182, 66, 80, 'XL']];
    }
    /*9001外其他外套
     if (cat==5)
     {
     var mydata = [[163,166,40,65,'M'],[163,166,66,75,'M'],[163,166,76,80,'L'],[163,166,81,85,'L'],[163,166,86,88,'XL'],[163,166,89,95,'XXL'],[167,169,40,65,'M'],[167,169,66,70,'M'],[167,169,71,75,'L'],[167,169,76,80,'L'],[167,169,81,85,'XL'],[167,169,86,95,'XXL'],[170,172,40,70,'M'],[170,172,71,75,'L'],[170,172,76,80,'L'],[170,172,81,85,'XL'],[170,172,86,95,'XXL'],[173,175,40,75,'L'],[173,175,76,80,'L'],[173,175,81,90,'XL'],[173,175,91,95,'XXL'],[176,178,40,75,'L'],[176,178,76,90,'XL'],[176,178,91,95,'XXL'],[179,182,40,65,'L'],[179,182,66,80,'XL'],[179,182,81,95,'XXL'],[183,188,40,95,'XXL']];
     }*/
    var ll = mydata.length;
    var ll_arr = ll - 1;
    var min_shengao = mydata[0][0];
    var min_tizhong = mydata[0][2];
    
    var max_shengao = mydata[0][1];
    var max_tizhong = mydata[0][3];
    //计算身高的最大值得
    
    for (y = 0; y < ll; y++) {
        if (max_shengao < mydata[y][1]) {
            //max_shengao = mydata[0][1];
            max_shengao = mydata[y][1];
            //mydata[y][1] = max_shengao;
        }
    }
    //计算体重的最大值得
    
    for (x = 0; x < ll; x++) {
        if (max_tizhong < mydata[x][3]) {
            //max_tizhong = mydata[0][3];
            max_tizhong = mydata[x][3];
            //mydata[x][3] = max_tizhong;
        }
    }
    //alert(max_tizhong);
    //开始判断
    if (standing < min_shengao || standing > max_shengao) {
        document.getElementById('result').innerHTML = '请填写范围内身高！';
        document.getElementById('result1').innerHTML = '请填写范围内身高！';
        return false;
    }
    
    if (weight < min_tizhong || weight > max_tizhong) {
        document.getElementById('result').innerHTML = '请填写范围内体重！';
        document.getElementById('result1').innerHTML = '请填写范围内体重！';
        return false;
    }
    
    var tmp_no = 0;//判识别能否得到尺码
    for (i = 0; i < ll; i++) {
        ///
        if (standing >= mydata[i][0] && standing <= mydata[i][1])//在身高区间
        {
            if (weight >= mydata[i][2] && weight <= mydata[i][3])//在体重区间
            {
                tmp_no = 1;
                document.getElementById('result').innerHTML = "我们建议您选择" + mydata[i][4] + "尺码";
                document.getElementById('result1').innerHTML = "我们建议您选择" + mydata[i][4] + "尺码";
                return true;
                /*alert(i);
                 alert(mydata[i][0]);
                 alert(mydata[i][1]);
                 alert(mydata[i][2]);
                 alert(mydata[i][3]);*/
                break;
            }
        }
        ////
    }
    //alert(tmp_no);
    if (tmp_no == 0) {
        document.getElementById('result').innerHTML = '没找到您合适的尺码！';
        document.getElementById('result1').innerHTML = '没找到您合适的尺码！';
        //return false;
    }
    return false;
}



function maxmin_hw(cat)//1 内衣   2   外套
{
    //var x;
    //var   neiku_table   =   new   Array({{12,13,14},{112,114,115}});
    if (cat == 1) {
        var mydata = [[163, 166, 40, 65, 'M'], [163, 166, 66, 75, 'M'], [163, 166, 76, 80, 'L'], [163, 166, 81, 85, 'L'], [163, 166, 86, 88, 'XL'], [163, 166, 89, 95, 'XL'], [167, 169, 40, 65, 'M'], [167, 169, 66, 70, 'M'], [167, 169, 71, 75, 'L'], [167, 169, 76, 80, 'L'], [167, 169, 81, 85, 'XL'], [167, 169, 86, 95, 'XL'], [170, 172, 40, 70, 'M'], [170, 172, 71, 75, 'L'], [170, 172, 76, 80, 'L'], [170, 172, 81, 85, 'XL'], [170, 172, 86, 95, 'XL'], [173, 175, 40, 75, 'L'], [173, 175, 76, 80, 'L'], [173, 175, 81, 90, 'XL'], [173, 175, 91, 95, 'XL'], [176, 178, 40, 75, 'L'], [176, 178, 76, 90, 'XL'], [176, 178, 91, 95, 'XL'], [179, 182, 40, 65, 'L'], [179, 182, 66, 80, 'XL'], [179, 182, 81, 95, 'XL'], [183, 188, 40, 95, 'XL']];
    }
    //9001外其他外套
    if (cat == 2) {
        //var mydata = [[163,166,40,65,'S'],[163,166,66,75,'M'],[163,166,76,80,'L'],[163,166,81,85,'L'],[163,166,86,88,'XL'],[167,169,40,65,'S'],[167,169,66,70,'M'],[167,169,71,75,'L'],[167,169,76,80,'L'],[167,169,81,85,'XL'],[170,172,40,70,'M'],[170,172,71,75,'L'],[170,172,76,80,'L'],[170,172,81,85,'XL'],[173,175,40,75,'L'],[173,175,76,80,'L'],[173,175,81,90,'XL'],[176,178,40,75,'L'],[176,178,76,90,'XL'],[179,182,40,65,'L'],[179,182,66,90,'XL']];
        var mydata = [[163, 166, 40, 65, 'M'], [163, 166, 66, 75, 'M'], [163, 166, 76, 80, 'L'], [163, 166, 81, 85, 'L'], [163, 166, 86, 88, 'XL'], [163, 166, 89, 95, 'XXL'], [167, 169, 40, 65, 'M'], [167, 169, 66, 70, 'M'], [167, 169, 71, 75, 'L'], [167, 169, 76, 80, 'L'], [167, 169, 81, 85, 'XL'], [167, 169, 86, 95, 'XXL'], [170, 172, 40, 70, 'M'], [170, 172, 71, 75, 'L'], [170, 172, 76, 80, 'L'], [170, 172, 81, 85, 'XL'], [170, 172, 86, 95, 'XXL'], [173, 175, 40, 75, 'L'], [173, 175, 76, 80, 'L'], [173, 175, 81, 90, 'XL'], [173, 175, 91, 95, 'XXL'], [176, 178, 40, 75, 'L'], [176, 178, 76, 90, 'XL'], [176, 178, 91, 95, 'XXL'], [179, 182, 40, 65, 'L'], [179, 182, 66, 80, 'XL'], [179, 182, 81, 95, 'XXL'], [183, 188, 40, 95, 'XXL']];
    }
    //毛衫
    if (cat == 3) {
        var mydata = [[163, 166, 40, 60, 'S'], [163, 166, 61, 75, 'M'], [163, 166, 76, 80, 'L'], [163, 166, 81, 85, 'L'], [163, 166, 86, 88, 'XL'], [163, 166, 89, 95, 'XXL'], [167, 169, 40, 60, 'S'], [167, 169, 61, 70, 'M'], [167, 169, 71, 75, 'L'], [167, 169, 76, 80, 'L'], [167, 169, 81, 85, 'XL'], [167, 169, 86, 95, 'XXL'], [170, 172, 40, 70, 'M'], [170, 172, 71, 75, 'L'], [170, 172, 76, 80, 'L'], [170, 172, 81, 85, 'XL'], [170, 172, 86, 95, 'XXL'], [173, 175, 40, 75, 'L'], [173, 175, 76, 80, 'L'], [173, 175, 81, 90, 'XL'], [173, 175, 91, 95, 'XXL'], [176, 178, 40, 75, 'L'], [176, 178, 76, 90, 'XL'], [176, 178, 91, 95, 'XXL'], [179, 182, 40, 65, 'L'], [179, 182, 66, 80, 'XL'], [179, 182, 81, 95, 'XXL'], [183, 188, 40, 95, 'XXL']];
    }
    //9001
    if (cat == 4) {
        var mydata = [[163, 166, 40, 65, 'S'], [163, 166, 66, 75, 'M'], [163, 166, 76, 80, 'L'], [163, 166, 81, 85, 'L'], [163, 166, 86, 88, 'XL'], [167, 169, 40, 65, 'S'], [167, 169, 66, 70, 'M'], [167, 169, 71, 75, 'L'], [167, 169, 76, 80, 'L'], [167, 169, 81, 85, 'XL'], [170, 172, 40, 70, 'M'], [170, 172, 71, 75, 'L'], [170, 172, 76, 80, 'L'], [170, 172, 81, 85, 'XL'], [173, 175, 40, 75, 'L'], [173, 175, 76, 80, 'L'], [173, 175, 81, 90, 'XL'], [176, 178, 40, 75, 'L'], [176, 178, 76, 90, 'XL'], [179, 182, 40, 65, 'L'], [179, 182, 66, 80, 'XL']];
    }
    /*9001外其他外套
     if (cat==5)
     {
     var mydata = [[163,166,40,65,'M'],[163,166,66,75,'M'],[163,166,76,80,'L'],[163,166,81,85,'L'],[163,166,86,88,'XL'],[163,166,89,95,'XXL'],[167,169,40,65,'M'],[167,169,66,70,'M'],[167,169,71,75,'L'],[167,169,76,80,'L'],[167,169,81,85,'XL'],[167,169,86,95,'XXL'],[170,172,40,70,'M'],[170,172,71,75,'L'],[170,172,76,80,'L'],[170,172,81,85,'XL'],[170,172,86,95,'XXL'],[173,175,40,75,'L'],[173,175,76,80,'L'],[173,175,81,90,'XL'],[173,175,91,95,'XXL'],[176,178,40,75,'L'],[176,178,76,90,'XL'],[176,178,91,95,'XXL'],[179,182,40,65,'L'],[179,182,66,80,'XL'],[179,182,81,95,'XXL'],[183,188,40,95,'XXL']];
     }*/
    var ll = mydata.length;
    var ll_arr = ll - 1;
    var min_shengao = mydata[0][0];
    var min_tizhong = mydata[0][2];
    
    var max_shengao = mydata[0][1];
    var max_tizhong = mydata[0][3];
    //计算身高的最大值得
    for (y = 0; y < ll; y++) {
        if (min_shengao > mydata[y][0]) {
            min_shengao = mydata[y][0];
        }
        if (max_shengao < mydata[y][1]) {
            max_shengao = mydata[y][1];
        }
    }
    document.getElementById('minmax_h').innerHTML = 'CM(' + min_shengao + '-' + max_shengao + ')';
    //计算体重的最大值得
    
    for (x = 0; x < ll; x++) {
        if (min_tizhong > mydata[x][2]) {
            min_tizhong = mydata[x][2];
        }
        if (max_tizhong < mydata[x][3]) {
            max_tizhong = mydata[x][3];
        }
    }
    document.getElementById('minmax_w').innerHTML = 'KG(' + min_tizhong + '-' + max_tizhong + ')';
}


